/**
 * Chesney's Fireplace System Includes New Supplier, New Fireplace Item, Supplier and Fireplace Update, 
 * Supplier and Fireplace Reports, Login, main menu and Tutorial.
 * 
 * It also Includes Database connection, Database Extension and the two classes which are MySupplier and My Fireplace.
 *  
 * Copyright (C) Bournemouth University 
 * 
 * @author Ruth Shepperd, Ari Lopez
 * 
 * @version 1.0
 */
package Database;
/**
* Class MySupplier.
* This Class creates supplier objects that will contain data from the database
* It has supplier, supplierName, address, town, postcode, telephoneNo,
* and email attributes.
* It also has static attributes that will refer to the above-mentioned attributes
* when an array is created to be passed as a parameter through a constructor method.
* 
* @author Ari Lopez and Ruth Shepperd
* 
* @version 1.0
* 
*/
public class MySupplier {
	// Attributes
	private String supplierID;
	private String supplierName;
	private String address;
	private String town;
	private String postcode;
	private String telephoneNo;
	private String email;

	// Giving parameters constants
	private static final int SUPPLIER_ID = 0;
	private static final int SUPPLIER_NAME = 1;
	private static final int ADDRESS = 2;
	private static final int TOWN = 3;
	private static final int POSTCODE = 4;
	private static final int TELEPHONE_NO = 5;
	private static final int EMAIL = 6;

	/**
	 * Default constructor method for MySupplier
	 */
	public MySupplier() {

	}

	/**
	 * Constructor Method to set data for each field in the Database
	 * 
	 * @param data
	 *            Data of each attribute (String Array)
	 */
	public MySupplier(String[] data) {
		this.supplierID = data[SUPPLIER_ID];
		this.supplierName = data[SUPPLIER_NAME];
		this.address = data[ADDRESS];
		this.postcode = data[POSTCODE];
		this.town = data[TOWN];
		this.telephoneNo = data[TELEPHONE_NO];
		this.email = data[EMAIL];
	}

	/**
	 * Get the Supplier ID
	 * 
	 * @return Supplier ID (as a String)
	 */
	public String getSupplierID() {
		return supplierID;
	}

	/**
	 * Set the Supplier ID
	 * 
	 * @param supplierID
	 *            The ID of the Supplier (String)
	 */
	public void setSupplierID(String supplierID) {
		this.supplierID = supplierID;
	}

	/**
	 * Get the Supplier Name
	 * 
	 * @return Supplier Name (as a String)
	 */
	public String getSupplierName() {
		return supplierName;
	}

	/**
	 * Set the Supplier Name
	 * 
	 * @param supplierName
	 *            The name of the Supplier (String)
	 */
	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	/**
	 * Get the Address
	 * 
	 * @return Address (as a String)
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * Set the Address
	 * 
	 * @param address
	 *            The address of the Supplier (String)
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * Get the Town
	 * 
	 * @return Town (as a String)
	 */
	public String getTown() {
		return town;
	}

	/**
	 * Set the Town
	 * 
	 * @param town
	 *            The town of the Supplier (String)
	 */
	public void setTown(String town) {
		this.town = town;
	}

	/**
	 * Get the PostCode
	 * 
	 * @return PostCode (as a String)
	 */
	public String getPostcode() {
		return postcode;
	}

	/**
	 * Set the PostCode
	 * 
	 * @param postcode
	 *            The PostCode of the Supplier (String)
	 */
	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	/**
	 * Get the Telephone Number
	 * 
	 * @return Telephone Number (as a String)
	 */
	public String getTelephoneNo() {
		return telephoneNo;
	}

	/**
	 * Set the Telephone Number
	 * 
	 * @param telephoneNo
	 *            The Telephone Number of the Supplier (String)
	 */
	public void setTelephoneNo(String telephoneNo) {
		this.telephoneNo = telephoneNo;
	}

	/**
	 * Get the Email
	 * 
	 * @return Email (as a String)
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * Set the Email
	 * 
	 * @param email
	 *            The email of the Supplier (String)
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	/**
	 * Get the Supplier Name
	 * @return Supplier Name (as a String)
	 */
	public String toString() {
		return supplierName;
	}
}
